
% addpath(genpath('pic/'));
% fullfile('data','my','result')
target_dir = 'Q4/';
fig_list = dir(target_dir);
len = length(fig_list);
for i = 1:len
    src_file_name = fig_list(i).name;
    if ~contains(src_file_name,'.fig')
        continue;
    end
%     disp(fullfile('pic',src_file_name))
    h = openfig(fullfile(target_dir,src_file_name));
    file_name = regexp(src_file_name,'.f','split');
    file_name = file_name(1);
    file_name = file_name{1};
    saveas(h, fullfile(target_dir,strcat(file_name, '.png')));
    pause(1)
    close all
end
% dirs = regexp(dir_name,';','split');
% [long,wide] = size(dirs);
% for i = 1:wide
%     disp(dirs{1,i});
% end